#ifndef CMODELMATRIX2D_H_
#define CMODELMATRIX2D_H_

#include "cmatrixbase.h"
#include "cvector2d.h"

/**
 * CModelMatrix2D - class representing 3x3 (2D space) modelview matrix
 * @author Michal Rost
 * @date 29.07.2007
 */
template <typename T>
class CModelMatrix2D : public CMatrixBase<T> {
public:
  CModelMatrix2D();
  CModelMatrix2D(T items[]);
  CModelMatrix2D(const CModelMatrix2D<T> &m);
  CModelMatrix2D(const CMatrixBase<T> &m);
  ~CModelMatrix2D();
  CModelMatrix2D<T>& operator = (const CModelMatrix2D<T> &m);
  CModelMatrix2D<T> operator + (const CModelMatrix2D<T> &m) const;
  CModelMatrix2D<T> operator - (const CModelMatrix2D<T> &m) const;
  CModelMatrix2D<T> operator * (const CModelMatrix2D<T> &m) const;
  CModelMatrix2D<T> operator * (T num) const;
  CModelMatrix2D<T> operator / (T num) const;
  TIndex getNumOfRows() const;
  TIndex getNumOfCols() const;
  void translate(T x, T y);
  void translate(const CVector2D<T> &v);
  void rescale(T x, T y);
  void rescale(const CVector2D<T> &v);
  void rotate(T angle);
  static CVector2D<T> mul(const CModelMatrix2D<T> &m, const CVector2D<T> &v);
  static CVector2D<T> mul(const CVector2D<T> &v, const CModelMatrix2D<T> &m);
  static string getClassName() {
    return"CModelMatrix2D";
  }
protected:
  void setNumOfRows(TIndex numOfRows) {}
  void setNumOfCols(TIndex numOfCols) {}
};

#endif
